package proj2501.main_frame;

import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;

class MainMenuBar extends JMenuBar {
	private MainFrame frame;
	private JMenu fileMenu;
	private JMenu windowMenu;
	
	public MainMenuBar(MainFrame frame) {
		this.frame = frame;
		
		fileMenu = new FileMenu();
		add(fileMenu);
		
		windowMenu = new WindowMenu();
		add(windowMenu);
	}
	
	private class FileMenu extends JMenu {
		public FileMenu() {
			super("File");
			JMenuItem quitItem = new JMenuItem();
			quitItem.setAction(frame.closeAction);
			add(quitItem);
		}
	}
	
	private class WindowMenu extends JMenu {
		public WindowMenu() {
			super("Window");
			JMenuItem fullScreenItem = new JMenuItem();
			fullScreenItem.setAction(frame.toggleFullScreenAction);
			add(fullScreenItem);
		}
	}
}
